package com.bootdo.appsystem.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.bootdo.appsystem.dao.RedrateDao;
import com.bootdo.appsystem.domain.RedrateDO;
import com.bootdo.appsystem.service.RedrateService;



@Service
public class RedrateServiceImpl implements RedrateService {
	@Autowired
	private RedrateDao redrateDao;

	@Override
	public RedrateDO get(Integer id){
		return redrateDao.get(id);
	}
	
	@Override
	public List<RedrateDO> list(Map<String, Object> map){
		return redrateDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return redrateDao.count(map);
	}
	
	@Override
	public int save(RedrateDO redrate){
		return redrateDao.save(redrate);
	}
	
	@Override
	public int update(RedrateDO redrate){
		return redrateDao.update(redrate);
	}
	
	@Override
	public int remove(Integer id){
		return redrateDao.remove(id);
	}
	
	@Override
	public int batchRemove(Integer[] ids){
		return redrateDao.batchRemove(ids);
	}

	@Override
	public RedrateDO getByDescription(String description) {
		HashMap map = new HashMap<String , Object>();
		map.put("description",description);
		return (RedrateDO)this.list(map).get(0);
	}

}
